#ifndef MYTHREAD1_H
#define MYTHREAD1_H

#include <QObject>
#include <QThread>
#include <QVector>
#include <QDebug>

//生成随机数
class mythread1 : public QThread
{
    Q_OBJECT
public:
    explicit mythread1(QObject *parent = nullptr);

    void run() override;

    ~mythread1();

public slots:
    void recvNum(int num);

signals:
    void sendArray(QVector<int>);


private:
    int _num;
};



// 用于冒泡排序
class mythread2 : public QThread
{
    Q_OBJECT
public:
    explicit mythread2(QObject *parent = nullptr);

    void run() override;

public slots:
    void recvArray(QVector<int> v);


signals:
    void sendArray(QVector<int>);


private:
    QVector<int> _v;
};



// 用于快速排序
class mythread3 : public QThread
{
    Q_OBJECT
public:
    explicit mythread3(QObject *parent = nullptr);

    void run() override;

    void InsertSort(QVector<int>& a,  int n);

public slots:
    void recvArray(QVector<int> v);


signals:
    void sendArray(QVector<int>);



private:
    QVector<int> _v;
};


#endif // MYTHREAD1_H



